<?php 
    
    function sredinaslov($css_id, $article_id, $subcolumn) {
        
        
        $css_id = str_replace(array(" ", "&nbsp;"), '-', $css_id);
        $css_id = str_replace(array("--", "---"), '-', $css_id);
        //$css_id = preg_replace("/[^a-zA-Z0-9 -]/", "", $css_id);  //allow only a-Z, integers and dashes
        //$css_id = preg_replace('/-{2,}/', '-', $css_id); // remove any double dashes that we resulted with from the previous steps


        $css_id = str_replace('Љ', 'љ', $css_id);
        $css_id = str_replace('Њ', 'њ', $css_id);
        $css_id = str_replace('Е', 'е', $css_id);
        $css_id = str_replace('Р', 'р', $css_id);

        $css_id = str_replace('Т', 'т', $css_id);
        $css_id = str_replace('З', 'з', $css_id);
        $css_id = str_replace('У', 'у', $css_id);
        $css_id = str_replace('И', 'и', $css_id);
        $css_id = str_replace('О', 'о', $css_id);
        $css_id = str_replace('П', 'п', $css_id);
        $css_id = str_replace('Ш', 'ш', $css_id);
        $css_id = str_replace('Ђ', 'ђ', $css_id);
        $css_id = str_replace('Ж', 'ж', $css_id);
        $css_id = str_replace('А', 'а', $css_id);
        $css_id = str_replace('С', 'с', $css_id);
        $css_id = str_replace('Д', 'д', $css_id);
        $css_id = str_replace('Ф', 'ф', $css_id);
        $css_id = str_replace('Г', 'г', $css_id);
        $css_id = str_replace('Х', 'х', $css_id);
        $css_id = str_replace('Ј', 'ј', $css_id);
        $css_id = str_replace('К', 'к', $css_id);
        $css_id = str_replace('Л', 'л', $css_id);
        $css_id = str_replace('Ч', 'ч', $css_id);
        $css_id = str_replace('Ћ', 'ћ', $css_id);
        $css_id = str_replace('Ѕ', 'ѕ', $css_id);
        $css_id = str_replace('Џ', 'џ', $css_id);
        $css_id = str_replace('Ц', 'ц', $css_id);
        $css_id = str_replace('В', 'в', $css_id);
        $css_id = str_replace('Б', 'б', $css_id);
        $css_id = str_replace('Н', 'н', $css_id);
        $css_id = str_replace('М', 'м', $css_id);
        $css_id = str_replace(',', '', $css_id);
        $css_id = str_replace('"', '', $css_id);
        $css_id = str_replace('?', '', $css_id);  
        $css_id = str_replace('.','', $css_id); 


        $css_id = str_replace(':', '', $css_id);
        $css_id = str_replace('@', '', $css_id);
        $css_id = str_replace('„', '', $css_id);  
        $css_id = str_replace('“','', $css_id); 
        $css_id = str_replace('”','', $css_id); 

        //$css_id = strtolower($css_id); 
        return mb_strtolower($subcolumn,'UTF-8').'/'.$css_id.'-'.$article_id;
    }
    
    function getArticle($id){
        $obj =& get_instance();
        return $obj->db->get_where('article',array('id'=>$id))->result_array();        
    }
?>
